package com.zjw.designPattern.proxy.jdkProxy;

import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

@Slf4j
public class ProxyHandle implements InvocationHandler {

    private Object proxyObject;

    public ProxyHandle(Object proxyObject) {
        this.proxyObject = proxyObject;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        method.invoke(proxyObject,args);
        log.info("代理对象开始执行");
        return null;
    }
}
